/*
** inventaire.c for zappy in /home/guidet_m/TECK2/projets/zappy/server_zappy
** 
** Made by michael guidet
** Login   <guidet_m@epitech.net>
** 
** Started on  Mon Jul  4 15:36:21 2011 michael guidet
** Last update Mon Jul 11 10:14:42 2011 michael guidet
*/

#include "server.h"

void	action_inventaire(t_fd *fd, t_env *e, char *cmd)
{
  char	cmd2[BUF_SIZE + 1];

  printf("%sDrone %d %s Execute %s%s\n", PURPLE, fd->pl->id,
	 fd->pl->team, cmd, DEFAUT);
  fd->wait = -1;
  fd->idaction = -1;
  fd->pl->ressource[NOURRITURE] =
    (int)(fd->pl->life / (126.0f / (float)e->t * 1000000.0f));
  sprintf(cmd2, INVENTORY,
	  fd->pl->ressource[NOURRITURE],
	  fd->pl->ressource[LINEMATE],
	  fd->pl->ressource[DERAUMERE],
	  fd->pl->ressource[SIBUR],
	  fd->pl->ressource[MENDIANE],
	  fd->pl->ressource[PHIRAS],
	  fd->pl->ressource[THYSTAME]);
  add_string_to_list(&fd->send_list, cmd2);
}
